/**
 * 用户数据层
 * Author: 梦里小白龙 <jiangwenshu@1990.com> <http://www.jz07.cn>
 */
var UserSQL = {  
    insert:'INSERT INTO users set ?', //添加数据
    checkName:'SELECT * FROM users WHERE user_name = ?', //判断用户名是否已注册
    getByUser:'SELECT user_name,password,sex,id FRPM users WHERE id = ?',   //获取用户详情
    updateUser:'UPDATE users SET user_name = ? , password = ? , sex = ? WHERE id = ?',  //修改用户
    delUser:'DELETE FROM users WHERE id = ?',  //删除用户
    login:'SELECT * FROM users WHERE user_name = ? AND password = ?', //用户登录
    lists:'SELECT * FROM users WHERE 1=1 and user_name like ? ORDER BY id DESC limit ? , ?',
    count:'SELECT COUNT(*) AS count FROM users where 1=1 and user_name like ?',
};
module.exports = UserSQL;